<?php
/**
 * bootstrap
 *
 * 프레임워크가 구동하기 전 전역에서 사용되어야 할 함수, 클래스, 설정등을 미리 로드합니다.
 *
 * @author Platform Team
 */

define('__FW_RUN__', true);
define('FW_VERSION', '1.3.14');
define('FW_DIR', dirname(dirname(__FILE__)));
define('DS', DIRECTORY_SEPARATOR);
define('EXT', '.php');

$preload = FW_DIR . '/bootstrap_.php';

if (is_file($preload) === true) {
    include $preload;
}
unset($preload);


if (defined('FW_ERROR_REPORTING') === false) {
    define('FW_ERROR_REPORTING', E_ALL & ~E_STRICT & ~E_NOTICE);
}

ini_set('error_reporting', FW_ERROR_REPORTING);


if (defined('FW_FRAMEWORK_NICK') === false) {
    define('FW_FRAMEWORK_NICK', 'framework');
}

if (defined('FW_MIDDLEWORK_NICK') === false) {
    define('FW_MIDDLEWORK_NICK', 'middlework');
}

if (defined('FW_PROJECT_NICK') === false) {
    define('FW_PROJECT_NICK', 'program');
}

if (defined('FW_MIDDLEWORK_USE') === false) {
    define('FW_MIDDLEWORK_USE', false);
}

define('FW_DIR_FRAMEWORK', FW_DIR . DS . FW_FRAMEWORK_NICK);
define('FW_DIR_MIDDLEWORK', FW_DIR . DS . FW_MIDDLEWORK_NICK);
define('FW_DIR_PROJECT', FW_DIR . DS . FW_PROJECT_NICK);



if (substr(PHP_OS, 0, 3) == 'WIN') {
    define('FW_OS', 'WIN');
    define('FW_OS_WIN', true);
    define('FW_OS_UNIX', false);
} else {
    define('FW_OS', 'UNIX');
    define('FW_OS_WIN', false);
    define('FW_OS_UNIX', true);
}

include FW_DIR_FRAMEWORK . '/conf/conf.define.php';
include FW_DIR_FRAMEWORK . '/conf/conf.func.php';
include FW_DIR_FRAMEWORK . '/conf/conf.path.php';
include FW_DIR_FRAMEWORK . '/conf/conf.autoload.php';
include FW_DIR_FRAMEWORK . '/conf/conf.uipack.php';
include FW_DIR_FRAMEWORK . '/conf/conf.boot.php';
include FW_DIR_FRAMEWORK . '/conf/conf.configure.php';
include FW_DIR_FRAMEWORK . '/conf/conf.hooker.php';
include FW_DIR_FRAMEWORK . '/conf/conf.exception.php';
include FW_DIR_FRAMEWORK . '/conf/conf.initialize.php';
include FW_DIR_FRAMEWORK . '/conf/conf.destruct.php';
include FW_DIR_FRAMEWORK . '/conf/conf.gpcr.php';

ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . FW_DIR_FRAMEWORK_VENDOR . DS . 'pear');
